#include "motion_proc.h"
#include "sqlitedb.h"

Motion_Proc::Motion_Proc(QObject *parent)
    :QObject(parent)
{
   moveC = getMotion(MOVEC);
   moveL = getMotion(MOVEL);
}

Motion Motion_Proc::getMotion(MOTIONTYPE motionType)
{
    //从数据库中获取名字
    SqliteDB db;
    db.connectDB();
    QString sql = QString::number(motionType, 10);
    sql = "select Title from Instructions where Type = 'Motion&Proc.' and Sign = "+ sql;
    QStringList list = db.getDBData(sql);

    Motion motion;
    motion.motiontype = motionType;
    motion.name = list.at(0);

    db.closeDB();

    return motion;
}

int Motion_Proc::flag()
{
    return m_flag;
}

void Motion_Proc::setFlag(int flg)
{
    this->m_flag = flg;
}
